/**
 * 
 */
package org.cuatrovientos.coin;

import java.util.Random;

/**
 * @author unai_inigo
 *
 */
public class Coin {
	/**
	 * flip a coin
	 * @return result
	 */
	public String flip(){
	Random random = new Random();
	int result = 0;
	String flipResult = "";
	
	result = random.nextInt(2);
	
	if (result==0){
		flipResult = "heads";
	}else{
		flipResult = "tails";
	}
	
	return flipResult;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Coin myCoin = new Coin();
		
		for (int i=0;i<100;i++){
			System.out.println(myCoin.flip());
		}

	}

}
